package com.lpb.spring.lpbspring.ioc;

import com.sun.org.apache.bcel.internal.generic.ATHROW;

import java.util.List;
import java.util.Map;

/**bean工厂接口
 * @ClassName BeanFactory
 * @Description TODO
 * @date 2022/11/22 17:29
 * @Version 1.0
 * @authoe linpengbo
 */
public interface BeanFactory {


    /**根据bean名称获取bean对象
     * @param beanName
     * @return
     * @throws Exception
     */
    Object getBean(String beanName)throws Exception;

    /**根据bean的class对象获取bean对象
     * @param clazz
     * @param <T>
     * @return
     * @throws Exception
     */
    <T> T getBean(Class<T> clazz)throws Exception;


    <T> Map<String,T> getBeansOfType(Class<T> type)throws Exception;

    <T> List<T> getBeansOfTypeList(Class<T> type) throws Exception;

    Class<?> getType(String beanName)throws Exception;

    /**注册bean的增强器
     * @param beanPostProcessor
     * @throws Exception
     */
    void registerBeanPostProcess(BeanPostProcessor beanPostProcessor)throws Exception;
}
